package com.jhte.scheduleJob.base.configuration;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author wuchun
 * @description 注册拦截器
 * @create 2018-01-08 11:19
 */
//标注此文件为一个配置项，spring boot才会扫描到该配置。该注解类似于之前使用xml进行配置
@Configuration
public class CustomWebMvcConfigurerAdapter extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //对来自/** 这个链接来的请求进行拦截
        //registry.addInterceptor(new InterceptorConfiguration()).addPathPatterns("/**");
    }
}
